<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>File: generate.rb</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



  <div id="fileHeader">
    <h1>generate.rb</h1>
    <table class="header-table">
    <tr class="top-aligned-row">
      <td><strong>Path:</strong></td>
      <td>generate.rb
      </td>
    </tr>
    <tr class="top-aligned-row">
      <td><strong>Last Update:</strong></td>
      <td>Sat Jul 28 15:53:46 +0200 2007</td>
    </tr>
    </table>
  </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <h2>Synopsis</h2>
<p>
Generates series of x-y values.Generated numbers respect what follows:
</p>
<ul>
<li>x is an integer number always starting from 1 and incrementing of 1 for
every generated value

</li>
<li>y is a real number

</li>
</ul>
<p>
The y value is generated by composing the following steps:
</p>
<ul>
<li>a user-specified function is applied on x

</li>
<li>a guassian distortion is applied on the result y=f(x)

</li>
<li>a normalization or shift within a user-specified range is applied.

</li>
</ul>
<h2>Usage</h2>
<pre>
  ruby generate.rb [ -h | --help] [options]
</pre>
<p>
The available options are:
</p>
<pre>
  -f function     : the generator function to use
  -n num          : the number of elements to generate (starting from 1)
  -s sigma        : the sigma to apply for gaussian distortion (0 for no distortion)
  -p psigma      : the percent-sigma to apply for gaussian distortion (0 for no distortion)
  -r range        : normalization range for y values, inclusive (es.: 0:5). Use only one bound to specify translations
</pre>
<p>
if -s and -ps sigma are missing, a -ps 0.1 is considered.
</p>
<h2>Example</h2>
<pre>
  ./generate.rb -f smooth_sin -n 1000 -p 0.2 -r 0:5
  ./generate.rb -f linear -n 100 -s 0.2 -r 5:
</pre>
<p>
To provide additional generators, edit stats/functions.rb
</p>
<h2>Author</h2>
<p>
Riccardo Govoni [battlehorse@gmail.com]
</p>
<h2>Copyright</h2>
<p>
Copyright(c) 2007 - bayes-swarm project. Licensed under the GNU General Public License v2.
</p>

    </div>

    <div id="requires-list">
      <h3 class="section-bar">Required files</h3>

      <div class="name-list">
      statistics2&nbsp;&nbsp;
      optparse&nbsp;&nbsp;
      rdoc/usage&nbsp;&nbsp;
      <a href="common_rb.html">common</a>&nbsp;&nbsp;
      statf/functions&nbsp;&nbsp;
      </div>
    </div>

   </div>


  </div>


    <!-- if includes -->

    <div id="section">



    <div id="aliases-list">
      <h3 class="section-bar">External Aliases</h3>

      <div class="name-list">
                        <table summary="aliases">
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">lambda</td>
          <td>-&gt;</td>
          <td class="context-item-value">function</td>
        </tr>
                        </table>
      </div>
    </div>


      


    <!-- if method_list -->


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>